Tagged: javascript Toggle Comment Threads | Keyboard Shortcuts

  • Subinkrishna Gopi 10:43 am on August 24, 2012 Permalink |
    Tags: , , javascript, jquery, , ,   

    Today’s read: Useful jQuery Function Demos For Your Projects 

    Smashing Magazine

    This one is a real good one. This article from Smashing Magazine gives you a very high level view of what jQuery can do. A real good starter for those who want to try out the possibilities of jQuery in their projects.

    Every aspiring Web developer should know about the power of JavaScript and how it can be used to enhance the ways in which people see and interact with Web pages. Fortunately, to help us be more productive, we can use the power of JavaScript libraries, and in this article we will take a good look at jQuery in action.

    Source: Smashing Magazine / Useful jQuery Function Demos For Your Projects

    Have a good read and make your hands dirty.

     
  • Subinkrishna Gopi 3:46 pm on February 25, 2010 Permalink |
    Tags: , javascript, , ,   

    Today’s read: The seven deadly sins of JavaScript implementation 

    A Smashing Magazine article on the common “sins” of JavaScript implementation by Christian Heilmann.

    Using JavaScript has become increasingly easy over the last few years. Whereas back in the day we needed to know the quirks of every browser, now many libraries such as jQuery, YUI, Dojo and MooTools allow someone who doesn’t even know JavaScript to spruce up boring HTML documents with impressive and shiny effects. By piggy-backing on the CSS selector engine, we have moved away from the complexity and inconsistencies of the DOM and made things much easier.

    If you look at some of the code that has been released, though, we do seem to have taken a step backwards. In gaining easier access, we also became a bit sloppy with our code. Finding clearly structured, easy-to-maintain jQuery code is quite tough, which is why many plug-ins do the same thing. Writing one yourself is faster than trying to fathom what other developers have done.

    Read the articleFollow the author in twitter !

     
  • Subinkrishna Gopi 11:37 am on February 23, 2010 Permalink |
    Tags: , help, htmlunit, , , javascript, memory leak, ,   

    HTMLUnit issue 

    We are using HTMLUnit in one of our modules and we use it to crawl through the webpages. But we are facing serious memory leak issues with HTMLUnit. We are unable to kill the JavaScript threads even after the functionality is completed. All my search to fix this issue ended up in one solution,

    webClient.closeAllWindows();
    

    But even this did not help us in solving the leak. The method call claims to kill all the running JavaScript threads associated with the WebClient though! If anyone can help us in fixing this, can share their thoughts here. I will update this post as soon as we have a solution.

    Thank you.

     
    • kkperf 11:28 pm on April 9, 2010 Permalink

      We seem to be running into a similar issue.
      We noticed “leaking windows” – always with a scriptable object tied to it. Here is what we did to confirm this (in addition to heap dump analysis)

      System.out.println(“windows size before closeAllWindows: ” + windows.size());
      webClient.closeAllWindows();
      System.out.println(“windows size after closeAllWindows: ” + windows.size());

      List windowsAfterClose = webClient.getWebWindows();
      System.out.println(“windowsAfterClose size: ” + windowsAfterClose.size());
      for (WebWindow ww : windowsAfterClose) {
      System.out.println(“Window name: ” + ww.getName());

      This shows that there is 1 window with no name still open.

      Trying to figure out whats going on. I’m going to perhaps end up logging a bug with htmlunit.
      Let me know if you have found a solution to the problem.
      Thanks
      -KK

    • kswenson 2:53 am on August 3, 2010 Permalink

      I have this exact problem.

      I have iterated through all the of the windows, gotten the ThreadManager, and interrupted all treads managed by those windows.

      Then I close all windows.

      But background JavaScript is still running. Every few seconds it creates a new thread and executes something.

      There is a class JavaScriptBackgroundJob which is running, but this class is not mentioned anywhere in the JavaDoc shipped with the library.

      I would appreciate help from anyone who can tell me how to COMPLETELY shut down all htmlunit processing.

    • Subinkrishna G 12:44 pm on August 4, 2010 Permalink

      We still dont have any solution 😦 I will update this post as soon as I have one.

  • Subinkrishna Gopi 11:39 am on July 9, 2009 Permalink |
    Tags: , bbc, frameworks, glow, javascript,   

    Todays read: BBC Glow 

    “Ouh, shiny! BBC’s Glow is finally out”

    I found this article in ajaxian.com. Read the article here.

    This article is about a new JavaScript framework recently open sourced by BBC. BBC Glow. BBC uses this framework in their websites. It’s too early for me to say whether this is a cool stuff to work with. Anyways you can try to make your hands dirty with “Glow”. Have a nice “Glow” time.

    bbc_glow

    What is BBC Glow?
    Glow is a JavaScript library which aims to make working with JavaScript and the DOM easier. It tries to do this by abstracting common tasks, hiding cross-browser issues, and providing a set of user interface widgets.

    Source: http://www.bbc.co.uk/glow/

    BBC Glow is free and open source.

    Download Glow
    Download source

    Related links
    What is Glow?
    Getting started
    More documentation

     
  • Subinkrishna Gopi 1:55 pm on June 16, 2009 Permalink |
    Tags: , , javascript, obfuscation, ,   

    JavaScript Obfuscation 

    What is an obfuscated code?source Wikipedia
    Obfuscated code is source code in a computer programming language that has been made difficult to understand. Programmers may deliberately obfuscate code to conceal its purpose (a form of security through obscurity), to deter reverse engineering, or as a puzzle or recreational challenge for readers. Programs known as obfuscators transform human-readable code into obfuscated code using various techniques.

    JavaScript obfuscation: Why & why not
    An obfuscated JavaScript code can help us in many ways – reduce the download time, more optimization and a fair amount of encryption. At the same time it got some serious disadvantages too – understandability is a distant dream where there is no readability.

    JavaScript obfuscation: How

    Try this piece code:

    // Get the value of all the form fields as a string
    function getFormParametersAsAString(aWebForm)
    {
     var inputs = aWebForm.getElementsByTagName('input');
     var formParameters = '';
     var anInput;
    
     if (inputs)
     {
       for (i = 0; i < inputs.length; i++)
       {
         anInput = inputs&#91;i&#93;;
         if (anInput.name && (anInput.name.length > 0) &&
            ("submit" != anInput.type) && ("reset" != anInput.type))
            formParameters += anInput.name + '=' + encodeURIComponent(anInput.value) + '&';
       }
     }
     return (formParameters);
    }
    

    And the obfuscated version:

    var _0xf8b7=["input","getElementsByTagName","","length","name","submit","type","reset","=","value","\x26"];
    function getFormParametersAsAString(aWebForm){var inputs=aWebForm[_0xf8b7[1]](_0xf8b7[0]);
    var formParameters=_0xf8b7[2];var anInput;if(inputs){for(i=0;i<inputs &#91;_0xf8b7&#91;3&#93;&#93;;i++){anInput=inputs&#91;i&#93;;
    if(anInput&#91;_0xf8b7&#91;4&#93;&#93;&&(anInput&#91;_0xf8b7&#91;4&#93;&#93;&#91;_0xf8b7&#91;3&#93;&#93;>0)&&(_0xf8b7[5]!=anInput[_0xf8b7[6]])&&(_0xf8b7[7]!=anInput[_0xf8b7[6]]))
    {formParameters+=anInput[_0xf8b7[4]]+_0xf8b7[8]+encodeURIComponent(anInput[_0xf8b7[9]])+_0xf8b7[10];} ;} ;} ;
    return (formParameters);} ;
    

    Made using http://www.javascriptobfuscator.com/

    You can try these obfuscators
    http://www.javascriptobfuscator.com/Default.aspx
    http://www.jasob.com/
    http://ajaxian.com/archives/utility-javascript-obfuscator – It’s Java based. Download the obfuscator Jar file

    References:
    http://en.wikipedia.org/wiki/Obfuscated_code

     
    • Subinkrishna G 2:16 pm on June 16, 2009 Permalink

      JavaScript obfuscation can really help us if we have huge chunks of code to be loaded and the time need to be minimized. It can really help in reducing the code size where we use lot of string constants and can make the code more optimized. Again, everything depends on the obfuscator.

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel